# Maintainer:
pkgname=py3-docformatter
pkgver=1.7.5
pkgrel=1
pkgdesc="Formats docstrings to follow PEP 257"
url="https://github.com/PyCQA/docformatter"
arch="noarch"
license="MIT"
depends="
	py3-charset-normalizer
	py3-untokenize
	"
makedepends="
	py3-gpep517
	py3-poetry-core
	"
checkdepends="
	black
	py3-mock
	py3-pytest-forked
	py3-pytest-xdist
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/PyCQA/docformatter/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/docformatter-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	(
		# shellcheck disable=1091
		. .testenv/bin/activate
		# dumb checks that seems to fail to add a space or whatever
		.testenv/bin/python3 -m pytest -n auto --forked \
			--deselect=tests/test_docformatter.py \
			--deselect=tests/test_configuration_functions.py
	)
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
bb3e7674845632be7b75151a874987582f7cba2682905b0527a1bb8cda37156931ade35cb712ffba91d510e89a45474d5df8f41bea6979cc933f7ec999cf01f4  py3-docformatter-1.7.5.tar.gz
"
